Fix(lsp-terraform): Adapt keywords to use underscores for lsp-mode core compatibility #4806
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes compilation errors in
clients/lsp-terraform.el
when used with recent versions oflsp-mode
20250531.742`Fixes #4805
Problem:
The
lsp-terraform.el
file (which has not been updated in the main repository for approximately a year) started failing to compile. The errors consistently followed the pattern:Error: Unknown key: :some-key-with-hyphen. Available keys: (... :some_key_with_underscore ...)
This occurred for several multi-word keywords within
lsp-defun
destructuring forms, such as:docs-link
(expected:docs_link
) and:provider-requirements
(expected:provider_requirements
).This suggests a change in
lsp-mode
core's keyword handling or its internal type definitions for data related toterraform-ls
, now favoring/expecting underscores for these specific multi-word keys.Solution:
This PR updates the affected keywords in
lsp-terraform.el
withinlsp-defun
parameter destructuring (for types like&terraform-ls:Module
,&terraform-ls:Providers
, etc.) to use the underscore convention, matching the "Available keys" provided in the compilation error messages. Corresponding local variable names have also been updated to use underscores.These changes allow
lsp-terraform.el
to compile successfully with the currentlsp-mode
core.